/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package modelo.tabla;

import java.sql.Date;
import java.util.ArrayList;
import java.util.Vector;
import javax.swing.table.AbstractTableModel;
import modelo.Ingresos;
import modelo.Intervencion;


/**
 *
 * @author jony
 */
public class JTableModelIngresos extends AbstractTableModel{
    
     private Vector<String> vColumnNames;
    private ArrayList<Ingresos> vdatosceldas;

    public JTableModelIngresos(Vector<String> vColumnNames, ArrayList<Ingresos> vdatosceldas) {
        this.vColumnNames = vColumnNames;
        this.vdatosceldas = vdatosceldas;
    }

    public void setVdatosceldas(ArrayList<Ingresos> vdatosceldas) {
        this.vdatosceldas = vdatosceldas;
    }

    @Override
    public int getRowCount() {
        return vdatosceldas.size();
    }

    @Override
    public int getColumnCount() {
        return vColumnNames.size();
    }

     @Override
    public Object getValueAt(int row, int column) {
        Ingresos ing = vdatosceldas.get(row);
        Object retorno = null;
        
          if (column == 0) {
            retorno = ing.getFechaAlta();
        } else if (column == 1) {
            retorno = ing.getFechaIngreso();
        } else if (column == 2) {
            retorno = ing.getIdIngreso();
        } else if (column == 3) {
            retorno = ing.getIdPA();
        }
        
        return retorno;
    }
    
 public Class<?> getColumnClass(int col) {
        if (col == 0) {

            return Date.class;
        } else if (col == 1) {

            return Date.class;
        } else if (col == 2) {
            return int.class;
        } else if (col == 3) {
            return int.class;
        
        }
       return null;
    }
    
    
}//FIN
